// Problem: 
// Contest: 
// URL: 
// Memory Limit: 
// Time Limit: 
// #pragma GCC optimize("Ofast")
// #pragma GCC optimize("unroll-loops")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#include<bits/stdc++.h>
using namespace std;
#define int long long
inline int read(){
	int s=0,w=1;
	char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')w=-1;ch=getchar();}
	while(ch>='0'&&ch<='9') s=s*10+ch-'0',ch=getchar();
	return s*w;
}
int s[11]={13,1,2,3,5,4,4,2,2,2};
signed main()
{
	int t=1;
//	cin>>t;
	while(t--)
	{
		int a=0,b=0,y=2000,m=1,d=1;
		while(1)
		{
			if((m%2==1&&m<=7)||(m%2==0&&m>=8))
			{
				if(d>31)
				{
					m++;
					d=1;
				}
			}
			else if(m==2)
			{
				if((y%1000==0&&y%400==0)||(y%1000!=0&&y%4==0))
				{
					if(d>29)
					{
						m++;
						d=1;
					}
				}
				else 
				{
					if(d>28)
					{
						m++;
						d=1;
					}
				}
			}
			else 
			{
				if(d>30)
				{
					m++;
					d=1;
				}
			}
			if(m>12)
			{
				y++;
				m=1;
			}
			if(y==2024&&m==4&&d==14)
			{
				cout<<b;
				return 0;
			}
			int sum=s[y%10]+s[(y%100)/10]+s[(y%1000)/100]+s[y/1000]
					+s[m%10]+s[m/10]+s[d%10]+s[d/10];
			if(sum>50)b++;
			else a++;
			d++;
		}
	}
	return 0;
}
